
/*
===============================================================================
                    EntitySpaces Studio by EntitySpaces, LLC
             Persistence Layer and Business Objects for Microsoft .NET
             EntitySpaces(TM) is a legal trademark of EntitySpaces, LLC
                          http://www.entityspaces.net
===============================================================================
EntitySpaces Version : 2012.1.0930.0
EntitySpaces Driver  : SQL
Date Generated       : 2016/10/18 13:43:34
===============================================================================
*/

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Linq;
using System.Data;
using System.ComponentModel;
using System.Xml.Serialization;
using System.Runtime.Serialization;

using EntitySpaces.Core;
using EntitySpaces.Interfaces;
using EntitySpaces.DynamicQuery;



namespace yncTech.BusinessObjects
{
	/// <summary>
	/// Encapsulates the 'Fin_Shipping' table
	/// </summary>

    [DebuggerDisplay("Data = {Debug}")]
	[Serializable]
	[DataContract]
	[KnownType(typeof(FinShipping))]	
	[XmlType("FinShipping")]
	public partial class FinShipping : esFinShipping
	{	
		[DebuggerBrowsable(DebuggerBrowsableState.RootHidden | DebuggerBrowsableState.Never)]
		protected override esEntityDebuggerView[] Debug
		{
			get { return base.Debug; }
		}

		override public esEntity CreateInstance()
		{
			return new FinShipping();
		}
		
		#region Static Quick Access Methods
		static public void Delete(System.Decimal shipID)
		{
			var obj = new FinShipping();
			obj.ShipID = shipID;
			obj.AcceptChanges();
			obj.MarkAsDeleted();
			obj.Save();
		}

	    static public void Delete(System.Decimal shipID, esSqlAccessType sqlAccessType)
		{
			var obj = new FinShipping();
			obj.ShipID = shipID;
			obj.AcceptChanges();
			obj.MarkAsDeleted();
			obj.Save(sqlAccessType);
		}
		#endregion

		
					
		
	
	}



    [DebuggerDisplay("Count = {Count}")]
	[Serializable]
	[CollectionDataContract]
	[XmlType("FinShippingCollection")]
	public partial class FinShippingCollection : esFinShippingCollection, IEnumerable<FinShipping>
	{
		public FinShipping FindByPrimaryKey(System.Decimal shipID)
		{
			return this.SingleOrDefault(e => e.ShipID == shipID);
		}

		
		
		#region WCF Service Class
		
		[DataContract]
		[KnownType(typeof(FinShipping))]
		public class FinShippingCollectionWCFPacket : esCollectionWCFPacket<FinShippingCollection>
		{
			public static implicit operator FinShippingCollection(FinShippingCollectionWCFPacket packet)
			{
				return packet.Collection;
			}

			public static implicit operator FinShippingCollectionWCFPacket(FinShippingCollection collection)
			{
				return new FinShippingCollectionWCFPacket() { Collection = collection };
			}
		}
		
		#endregion
		
				
	}



    [DebuggerDisplay("Query = {Parse()}")]
	[Serializable]	
	public partial class FinShippingQuery : esFinShippingQuery
	{
        public FinShippingQuery() : this("FinShippingQuery")
		{
		}
		public FinShippingQuery(string joinAlias)
		{
			this.es.JoinAlias = joinAlias;
		}	

		override protected string GetQueryName()
		{
			return "FinShippingQuery";
		}
		
					
	
		#region Explicit Casts
		
		public static explicit operator string(FinShippingQuery query)
		{
			return FinShippingQuery.SerializeHelper.ToXml(query);
		}

		public static explicit operator FinShippingQuery(string query)
		{
			return (FinShippingQuery)FinShippingQuery.SerializeHelper.FromXml(query, typeof(FinShippingQuery));
		}
		
		#endregion		
	}

	[DataContract]
	[Serializable]
	abstract public partial class esFinShipping : esEntity
	{
		public esFinShipping()
		{

		}
		
		#region LoadByPrimaryKey
		public virtual bool LoadByPrimaryKey(System.Decimal shipID)
		{
			if(this.es.Connection.SqlAccessType == esSqlAccessType.DynamicSQL)
				return LoadByPrimaryKeyDynamic(shipID);
			else
				return LoadByPrimaryKeyStoredProcedure(shipID);
		}

		public virtual bool LoadByPrimaryKey(esSqlAccessType sqlAccessType, System.Decimal shipID)
		{
			if (sqlAccessType == esSqlAccessType.DynamicSQL)
				return LoadByPrimaryKeyDynamic(shipID);
			else
				return LoadByPrimaryKeyStoredProcedure(shipID);
		}

		private bool LoadByPrimaryKeyDynamic(System.Decimal shipID)
		{
			FinShippingQuery query = new FinShippingQuery();
			query.Where(query.ShipID == shipID);
			return this.Load(query);
		}

		private bool LoadByPrimaryKeyStoredProcedure(System.Decimal shipID)
		{
			esParameters parms = new esParameters();
			parms.Add("ShipID", shipID);
			return this.Load(esQueryType.StoredProcedure, this.es.spLoadByPrimaryKey, parms);
		}
		#endregion
		
		#region Properties
		
		
		
		/// <summary>
		/// Maps to Fin_Shipping.ShipID
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Decimal? ShipID
		{
			get
			{
				return base.GetSystemDecimal(FinShippingMetadata.ColumnNames.ShipID);
			}
			
			set
			{
				if(base.SetSystemDecimal(FinShippingMetadata.ColumnNames.ShipID, value))
				{
					OnPropertyChanged(FinShippingMetadata.PropertyNames.ShipID);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Shipping.SupplierBoxNo
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String SupplierBoxNo
		{
			get
			{
				return base.GetSystemString(FinShippingMetadata.ColumnNames.SupplierBoxNo);
			}
			
			set
			{
				if(base.SetSystemString(FinShippingMetadata.ColumnNames.SupplierBoxNo, value))
				{
					OnPropertyChanged(FinShippingMetadata.PropertyNames.SupplierBoxNo);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Shipping.TransferType
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String TransferType
		{
			get
			{
				return base.GetSystemString(FinShippingMetadata.ColumnNames.TransferType);
			}
			
			set
			{
				if(base.SetSystemString(FinShippingMetadata.ColumnNames.TransferType, value))
				{
					OnPropertyChanged(FinShippingMetadata.PropertyNames.TransferType);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Shipping.FromDestination
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Decimal? FromDestination
		{
			get
			{
				return base.GetSystemDecimal(FinShippingMetadata.ColumnNames.FromDestination);
			}
			
			set
			{
				if(base.SetSystemDecimal(FinShippingMetadata.ColumnNames.FromDestination, value))
				{
					OnPropertyChanged(FinShippingMetadata.PropertyNames.FromDestination);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Shipping.ToDestination
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Decimal? ToDestination
		{
			get
			{
				return base.GetSystemDecimal(FinShippingMetadata.ColumnNames.ToDestination);
			}
			
			set
			{
				if(base.SetSystemDecimal(FinShippingMetadata.ColumnNames.ToDestination, value))
				{
					OnPropertyChanged(FinShippingMetadata.PropertyNames.ToDestination);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Shipping.Replay
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String Replay
		{
			get
			{
				return base.GetSystemString(FinShippingMetadata.ColumnNames.Replay);
			}
			
			set
			{
				if(base.SetSystemString(FinShippingMetadata.ColumnNames.Replay, value))
				{
					OnPropertyChanged(FinShippingMetadata.PropertyNames.Replay);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Shipping.ReplayDttm
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.DateTime? ReplayDttm
		{
			get
			{
				return base.GetSystemDateTime(FinShippingMetadata.ColumnNames.ReplayDttm);
			}
			
			set
			{
				if(base.SetSystemDateTime(FinShippingMetadata.ColumnNames.ReplayDttm, value))
				{
					OnPropertyChanged(FinShippingMetadata.PropertyNames.ReplayDttm);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Shipping.ReplayStatus
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String ReplayStatus
		{
			get
			{
				return base.GetSystemString(FinShippingMetadata.ColumnNames.ReplayStatus);
			}
			
			set
			{
				if(base.SetSystemString(FinShippingMetadata.ColumnNames.ReplayStatus, value))
				{
					OnPropertyChanged(FinShippingMetadata.PropertyNames.ReplayStatus);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Shipping.IsChecked
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Boolean? IsChecked
		{
			get
			{
				return base.GetSystemBoolean(FinShippingMetadata.ColumnNames.IsChecked);
			}
			
			set
			{
				if(base.SetSystemBoolean(FinShippingMetadata.ColumnNames.IsChecked, value))
				{
					OnPropertyChanged(FinShippingMetadata.PropertyNames.IsChecked);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Shipping.Check1
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String Check1
		{
			get
			{
				return base.GetSystemString(FinShippingMetadata.ColumnNames.Check1);
			}
			
			set
			{
				if(base.SetSystemString(FinShippingMetadata.ColumnNames.Check1, value))
				{
					OnPropertyChanged(FinShippingMetadata.PropertyNames.Check1);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Shipping.CheckDttm1
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.DateTime? CheckDttm1
		{
			get
			{
				return base.GetSystemDateTime(FinShippingMetadata.ColumnNames.CheckDttm1);
			}
			
			set
			{
				if(base.SetSystemDateTime(FinShippingMetadata.ColumnNames.CheckDttm1, value))
				{
					OnPropertyChanged(FinShippingMetadata.PropertyNames.CheckDttm1);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Shipping.Check2
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String Check2
		{
			get
			{
				return base.GetSystemString(FinShippingMetadata.ColumnNames.Check2);
			}
			
			set
			{
				if(base.SetSystemString(FinShippingMetadata.ColumnNames.Check2, value))
				{
					OnPropertyChanged(FinShippingMetadata.PropertyNames.Check2);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Shipping.CheckDttm2
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.DateTime? CheckDttm2
		{
			get
			{
				return base.GetSystemDateTime(FinShippingMetadata.ColumnNames.CheckDttm2);
			}
			
			set
			{
				if(base.SetSystemDateTime(FinShippingMetadata.ColumnNames.CheckDttm2, value))
				{
					OnPropertyChanged(FinShippingMetadata.PropertyNames.CheckDttm2);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Shipping.TransportType
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String TransportType
		{
			get
			{
				return base.GetSystemString(FinShippingMetadata.ColumnNames.TransportType);
			}
			
			set
			{
				if(base.SetSystemString(FinShippingMetadata.ColumnNames.TransportType, value))
				{
					OnPropertyChanged(FinShippingMetadata.PropertyNames.TransportType);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Shipping.ReceivedBy
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String ReceivedBy
		{
			get
			{
				return base.GetSystemString(FinShippingMetadata.ColumnNames.ReceivedBy);
			}
			
			set
			{
				if(base.SetSystemString(FinShippingMetadata.ColumnNames.ReceivedBy, value))
				{
					OnPropertyChanged(FinShippingMetadata.PropertyNames.ReceivedBy);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Shipping.ReceivedDttm
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.DateTime? ReceivedDttm
		{
			get
			{
				return base.GetSystemDateTime(FinShippingMetadata.ColumnNames.ReceivedDttm);
			}
			
			set
			{
				if(base.SetSystemDateTime(FinShippingMetadata.ColumnNames.ReceivedDttm, value))
				{
					OnPropertyChanged(FinShippingMetadata.PropertyNames.ReceivedDttm);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Shipping.Sender
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String Sender
		{
			get
			{
				return base.GetSystemString(FinShippingMetadata.ColumnNames.Sender);
			}
			
			set
			{
				if(base.SetSystemString(FinShippingMetadata.ColumnNames.Sender, value))
				{
					OnPropertyChanged(FinShippingMetadata.PropertyNames.Sender);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Shipping.ShippingDate
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.DateTime? ShippingDate
		{
			get
			{
				return base.GetSystemDateTime(FinShippingMetadata.ColumnNames.ShippingDate);
			}
			
			set
			{
				if(base.SetSystemDateTime(FinShippingMetadata.ColumnNames.ShippingDate, value))
				{
					OnPropertyChanged(FinShippingMetadata.PropertyNames.ShippingDate);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Shipping.AttachmentName
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String AttachmentName
		{
			get
			{
				return base.GetSystemString(FinShippingMetadata.ColumnNames.AttachmentName);
			}
			
			set
			{
				if(base.SetSystemString(FinShippingMetadata.ColumnNames.AttachmentName, value))
				{
					OnPropertyChanged(FinShippingMetadata.PropertyNames.AttachmentName);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Shipping.ShippingStatus
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String ShippingStatus
		{
			get
			{
				return base.GetSystemString(FinShippingMetadata.ColumnNames.ShippingStatus);
			}
			
			set
			{
				if(base.SetSystemString(FinShippingMetadata.ColumnNames.ShippingStatus, value))
				{
					OnPropertyChanged(FinShippingMetadata.PropertyNames.ShippingStatus);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Shipping.Comments
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String Comments
		{
			get
			{
				return base.GetSystemString(FinShippingMetadata.ColumnNames.Comments);
			}
			
			set
			{
				if(base.SetSystemString(FinShippingMetadata.ColumnNames.Comments, value))
				{
					OnPropertyChanged(FinShippingMetadata.PropertyNames.Comments);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Shipping.CreatedBy
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String CreatedBy
		{
			get
			{
				return base.GetSystemString(FinShippingMetadata.ColumnNames.CreatedBy);
			}
			
			set
			{
				if(base.SetSystemString(FinShippingMetadata.ColumnNames.CreatedBy, value))
				{
					OnPropertyChanged(FinShippingMetadata.PropertyNames.CreatedBy);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Shipping.CreatedDttm
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.DateTime? CreatedDttm
		{
			get
			{
				return base.GetSystemDateTime(FinShippingMetadata.ColumnNames.CreatedDttm);
			}
			
			set
			{
				if(base.SetSystemDateTime(FinShippingMetadata.ColumnNames.CreatedDttm, value))
				{
					OnPropertyChanged(FinShippingMetadata.PropertyNames.CreatedDttm);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Shipping.UpdatedBy
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String UpdatedBy
		{
			get
			{
				return base.GetSystemString(FinShippingMetadata.ColumnNames.UpdatedBy);
			}
			
			set
			{
				if(base.SetSystemString(FinShippingMetadata.ColumnNames.UpdatedBy, value))
				{
					OnPropertyChanged(FinShippingMetadata.PropertyNames.UpdatedBy);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Shipping.UpdatedDttm
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.DateTime? UpdatedDttm
		{
			get
			{
				return base.GetSystemDateTime(FinShippingMetadata.ColumnNames.UpdatedDttm);
			}
			
			set
			{
				if(base.SetSystemDateTime(FinShippingMetadata.ColumnNames.UpdatedDttm, value))
				{
					OnPropertyChanged(FinShippingMetadata.PropertyNames.UpdatedDttm);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_Shipping.ShipManagerMail
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String ShipManagerMail
		{
			get
			{
				return base.GetSystemString(FinShippingMetadata.ColumnNames.ShipManagerMail);
			}
			
			set
			{
				if(base.SetSystemString(FinShippingMetadata.ColumnNames.ShipManagerMail, value))
				{
					OnPropertyChanged(FinShippingMetadata.PropertyNames.ShipManagerMail);
				}
			}
		}		
		
		#endregion	

		#region .str() Properties
		
		public override void SetProperties(IDictionary values)
		{
			foreach (string propertyName in values.Keys)
			{
				this.SetProperty(propertyName, values[propertyName]);
			}
		}
		
		public override void SetProperty(string name, object value)
		{
			esColumnMetadata col = this.Meta.Columns.FindByPropertyName(name);
			if (col != null)
			{
				if(value == null || value is System.String)
				{				
					// Use the strongly typed property
					switch (name)
					{							
						case "ShipID": this.str().ShipID = (string)value; break;							
						case "SupplierBoxNo": this.str().SupplierBoxNo = (string)value; break;							
						case "TransferType": this.str().TransferType = (string)value; break;							
						case "FromDestination": this.str().FromDestination = (string)value; break;							
						case "ToDestination": this.str().ToDestination = (string)value; break;							
						case "Replay": this.str().Replay = (string)value; break;							
						case "ReplayDttm": this.str().ReplayDttm = (string)value; break;							
						case "ReplayStatus": this.str().ReplayStatus = (string)value; break;							
						case "IsChecked": this.str().IsChecked = (string)value; break;							
						case "Check1": this.str().Check1 = (string)value; break;							
						case "CheckDttm1": this.str().CheckDttm1 = (string)value; break;							
						case "Check2": this.str().Check2 = (string)value; break;							
						case "CheckDttm2": this.str().CheckDttm2 = (string)value; break;							
						case "TransportType": this.str().TransportType = (string)value; break;							
						case "ReceivedBy": this.str().ReceivedBy = (string)value; break;							
						case "ReceivedDttm": this.str().ReceivedDttm = (string)value; break;							
						case "Sender": this.str().Sender = (string)value; break;							
						case "ShippingDate": this.str().ShippingDate = (string)value; break;							
						case "AttachmentName": this.str().AttachmentName = (string)value; break;							
						case "ShippingStatus": this.str().ShippingStatus = (string)value; break;							
						case "Comments": this.str().Comments = (string)value; break;							
						case "CreatedBy": this.str().CreatedBy = (string)value; break;							
						case "CreatedDttm": this.str().CreatedDttm = (string)value; break;							
						case "UpdatedBy": this.str().UpdatedBy = (string)value; break;							
						case "UpdatedDttm": this.str().UpdatedDttm = (string)value; break;							
						case "ShipManagerMail": this.str().ShipManagerMail = (string)value; break;
					}
				}
				else
				{
					switch (name)
					{	
						case "ShipID":
						
							if (value == null || value is System.Decimal)
								this.ShipID = (System.Decimal?)value;
								OnPropertyChanged(FinShippingMetadata.PropertyNames.ShipID);
							break;
						
						case "FromDestination":
						
							if (value == null || value is System.Decimal)
								this.FromDestination = (System.Decimal?)value;
								OnPropertyChanged(FinShippingMetadata.PropertyNames.FromDestination);
							break;
						
						case "ToDestination":
						
							if (value == null || value is System.Decimal)
								this.ToDestination = (System.Decimal?)value;
								OnPropertyChanged(FinShippingMetadata.PropertyNames.ToDestination);
							break;
						
						case "ReplayDttm":
						
							if (value == null || value is System.DateTime)
								this.ReplayDttm = (System.DateTime?)value;
								OnPropertyChanged(FinShippingMetadata.PropertyNames.ReplayDttm);
							break;
						
						case "IsChecked":
						
							if (value == null || value is System.Boolean)
								this.IsChecked = (System.Boolean?)value;
								OnPropertyChanged(FinShippingMetadata.PropertyNames.IsChecked);
							break;
						
						case "CheckDttm1":
						
							if (value == null || value is System.DateTime)
								this.CheckDttm1 = (System.DateTime?)value;
								OnPropertyChanged(FinShippingMetadata.PropertyNames.CheckDttm1);
							break;
						
						case "CheckDttm2":
						
							if (value == null || value is System.DateTime)
								this.CheckDttm2 = (System.DateTime?)value;
								OnPropertyChanged(FinShippingMetadata.PropertyNames.CheckDttm2);
							break;
						
						case "ReceivedDttm":
						
							if (value == null || value is System.DateTime)
								this.ReceivedDttm = (System.DateTime?)value;
								OnPropertyChanged(FinShippingMetadata.PropertyNames.ReceivedDttm);
							break;
						
						case "ShippingDate":
						
							if (value == null || value is System.DateTime)
								this.ShippingDate = (System.DateTime?)value;
								OnPropertyChanged(FinShippingMetadata.PropertyNames.ShippingDate);
							break;
						
						case "CreatedDttm":
						
							if (value == null || value is System.DateTime)
								this.CreatedDttm = (System.DateTime?)value;
								OnPropertyChanged(FinShippingMetadata.PropertyNames.CreatedDttm);
							break;
						
						case "UpdatedDttm":
						
							if (value == null || value is System.DateTime)
								this.UpdatedDttm = (System.DateTime?)value;
								OnPropertyChanged(FinShippingMetadata.PropertyNames.UpdatedDttm);
							break;
					

						default:
							break;
					}
				}
			}
            else if (this.ContainsColumn(name))
            {
                this.SetColumn(name, value);
            }
			else
			{
				throw new Exception("SetProperty Error: '" + name + "' not found");
			}
		}		

		public esStrings str()
		{
			if (esstrings == null)
			{
				esstrings = new esStrings(this);
			}
			return esstrings;
		}

		sealed public class esStrings
		{
			public esStrings(esFinShipping entity)
			{
				this.entity = entity;
			}
			
	
			public System.String ShipID
			{
				get
				{
					System.Decimal? data = entity.ShipID;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.ShipID = null;
					else entity.ShipID = Convert.ToDecimal(value);
				}
			}
				
			public System.String SupplierBoxNo
			{
				get
				{
					System.String data = entity.SupplierBoxNo;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.SupplierBoxNo = null;
					else entity.SupplierBoxNo = Convert.ToString(value);
				}
			}
				
			public System.String TransferType
			{
				get
				{
					System.String data = entity.TransferType;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.TransferType = null;
					else entity.TransferType = Convert.ToString(value);
				}
			}
				
			public System.String FromDestination
			{
				get
				{
					System.Decimal? data = entity.FromDestination;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.FromDestination = null;
					else entity.FromDestination = Convert.ToDecimal(value);
				}
			}
				
			public System.String ToDestination
			{
				get
				{
					System.Decimal? data = entity.ToDestination;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.ToDestination = null;
					else entity.ToDestination = Convert.ToDecimal(value);
				}
			}
				
			public System.String Replay
			{
				get
				{
					System.String data = entity.Replay;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.Replay = null;
					else entity.Replay = Convert.ToString(value);
				}
			}
				
			public System.String ReplayDttm
			{
				get
				{
					System.DateTime? data = entity.ReplayDttm;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.ReplayDttm = null;
					else entity.ReplayDttm = Convert.ToDateTime(value);
				}
			}
				
			public System.String ReplayStatus
			{
				get
				{
					System.String data = entity.ReplayStatus;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.ReplayStatus = null;
					else entity.ReplayStatus = Convert.ToString(value);
				}
			}
				
			public System.String IsChecked
			{
				get
				{
					System.Boolean? data = entity.IsChecked;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.IsChecked = null;
					else entity.IsChecked = Convert.ToBoolean(value);
				}
			}
				
			public System.String Check1
			{
				get
				{
					System.String data = entity.Check1;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.Check1 = null;
					else entity.Check1 = Convert.ToString(value);
				}
			}
				
			public System.String CheckDttm1
			{
				get
				{
					System.DateTime? data = entity.CheckDttm1;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.CheckDttm1 = null;
					else entity.CheckDttm1 = Convert.ToDateTime(value);
				}
			}
				
			public System.String Check2
			{
				get
				{
					System.String data = entity.Check2;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.Check2 = null;
					else entity.Check2 = Convert.ToString(value);
				}
			}
				
			public System.String CheckDttm2
			{
				get
				{
					System.DateTime? data = entity.CheckDttm2;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.CheckDttm2 = null;
					else entity.CheckDttm2 = Convert.ToDateTime(value);
				}
			}
				
			public System.String TransportType
			{
				get
				{
					System.String data = entity.TransportType;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.TransportType = null;
					else entity.TransportType = Convert.ToString(value);
				}
			}
				
			public System.String ReceivedBy
			{
				get
				{
					System.String data = entity.ReceivedBy;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.ReceivedBy = null;
					else entity.ReceivedBy = Convert.ToString(value);
				}
			}
				
			public System.String ReceivedDttm
			{
				get
				{
					System.DateTime? data = entity.ReceivedDttm;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.ReceivedDttm = null;
					else entity.ReceivedDttm = Convert.ToDateTime(value);
				}
			}
				
			public System.String Sender
			{
				get
				{
					System.String data = entity.Sender;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.Sender = null;
					else entity.Sender = Convert.ToString(value);
				}
			}
				
			public System.String ShippingDate
			{
				get
				{
					System.DateTime? data = entity.ShippingDate;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.ShippingDate = null;
					else entity.ShippingDate = Convert.ToDateTime(value);
				}
			}
				
			public System.String AttachmentName
			{
				get
				{
					System.String data = entity.AttachmentName;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.AttachmentName = null;
					else entity.AttachmentName = Convert.ToString(value);
				}
			}
				
			public System.String ShippingStatus
			{
				get
				{
					System.String data = entity.ShippingStatus;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.ShippingStatus = null;
					else entity.ShippingStatus = Convert.ToString(value);
				}
			}
				
			public System.String Comments
			{
				get
				{
					System.String data = entity.Comments;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.Comments = null;
					else entity.Comments = Convert.ToString(value);
				}
			}
				
			public System.String CreatedBy
			{
				get
				{
					System.String data = entity.CreatedBy;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.CreatedBy = null;
					else entity.CreatedBy = Convert.ToString(value);
				}
			}
				
			public System.String CreatedDttm
			{
				get
				{
					System.DateTime? data = entity.CreatedDttm;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.CreatedDttm = null;
					else entity.CreatedDttm = Convert.ToDateTime(value);
				}
			}
				
			public System.String UpdatedBy
			{
				get
				{
					System.String data = entity.UpdatedBy;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.UpdatedBy = null;
					else entity.UpdatedBy = Convert.ToString(value);
				}
			}
				
			public System.String UpdatedDttm
			{
				get
				{
					System.DateTime? data = entity.UpdatedDttm;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.UpdatedDttm = null;
					else entity.UpdatedDttm = Convert.ToDateTime(value);
				}
			}
				
			public System.String ShipManagerMail
			{
				get
				{
					System.String data = entity.ShipManagerMail;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.ShipManagerMail = null;
					else entity.ShipManagerMail = Convert.ToString(value);
				}
			}
			

			private esFinShipping entity;
		}
		
		[NonSerialized]
		private esStrings esstrings;		
		
		#endregion
		
		#region Housekeeping methods

		override protected IMetadata Meta
		{
			get
			{
				return FinShippingMetadata.Meta();
			}
		}

		#endregion		
		
		#region Query Logic

		public FinShippingQuery Query
		{
			get
			{
				if (this.query == null)
				{
					this.query = new FinShippingQuery();
					InitQuery(this.query);
				}

				return this.query;
			}
		}

		public bool Load(FinShippingQuery query)
		{
			this.query = query;
			InitQuery(this.query);
			return this.Query.Load();
		}
		
		protected void InitQuery(FinShippingQuery query)
		{
			query.OnLoadDelegate = this.OnQueryLoaded;
			
			if (!query.es2.HasConnection)
			{
				query.es2.Connection = ((IEntity)this).Connection;
			}			
		}

		#endregion
		
        [IgnoreDataMember]
		private FinShippingQuery query;		
	}



	[Serializable]
	abstract public partial class esFinShippingCollection : esEntityCollection<FinShipping>
	{
		#region Housekeeping methods
		override protected IMetadata Meta
		{
			get
			{
				return FinShippingMetadata.Meta();
			}
		}

		protected override string GetCollectionName()
		{
			return "FinShippingCollection";
		}

		#endregion		
		
		#region Query Logic

	#if (!WindowsCE)
		[BrowsableAttribute(false)]
	#endif
		public FinShippingQuery Query
		{
			get
			{
				if (this.query == null)
				{
					this.query = new FinShippingQuery();
					InitQuery(this.query);
				}

				return this.query;
			}
		}

		public bool Load(FinShippingQuery query)
		{
			this.query = query;
			InitQuery(this.query);
			return Query.Load();
		}

		override protected esDynamicQuery GetDynamicQuery()
		{
			if (this.query == null)
			{
				this.query = new FinShippingQuery();
				this.InitQuery(query);
			}
			return this.query;
		}

		protected void InitQuery(FinShippingQuery query)
		{
			query.OnLoadDelegate = this.OnQueryLoaded;
			
			if (!query.es2.HasConnection)
			{
				query.es2.Connection = ((IEntityCollection)this).Connection;
			}			
		}

		protected override void HookupQuery(esDynamicQuery query)
		{
			this.InitQuery((FinShippingQuery)query);
		}

		#endregion
		
		private FinShippingQuery query;
	}



	[Serializable]
	abstract public partial class esFinShippingQuery : esDynamicQuery
	{
		override protected IMetadata Meta
		{
			get
			{
				return FinShippingMetadata.Meta();
			}
		}	
		
		#region QueryItemFromName
		
        protected override esQueryItem QueryItemFromName(string name)
        {
            switch (name)
            {
				case "ShipID": return this.ShipID;
				case "SupplierBoxNo": return this.SupplierBoxNo;
				case "TransferType": return this.TransferType;
				case "FromDestination": return this.FromDestination;
				case "ToDestination": return this.ToDestination;
				case "Replay": return this.Replay;
				case "ReplayDttm": return this.ReplayDttm;
				case "ReplayStatus": return this.ReplayStatus;
				case "IsChecked": return this.IsChecked;
				case "Check1": return this.Check1;
				case "CheckDttm1": return this.CheckDttm1;
				case "Check2": return this.Check2;
				case "CheckDttm2": return this.CheckDttm2;
				case "TransportType": return this.TransportType;
				case "ReceivedBy": return this.ReceivedBy;
				case "ReceivedDttm": return this.ReceivedDttm;
				case "Sender": return this.Sender;
				case "ShippingDate": return this.ShippingDate;
				case "AttachmentName": return this.AttachmentName;
				case "ShippingStatus": return this.ShippingStatus;
				case "Comments": return this.Comments;
				case "CreatedBy": return this.CreatedBy;
				case "CreatedDttm": return this.CreatedDttm;
				case "UpdatedBy": return this.UpdatedBy;
				case "UpdatedDttm": return this.UpdatedDttm;
				case "ShipManagerMail": return this.ShipManagerMail;

                default: return null;
            }
        }		
		
		#endregion
		
		#region esQueryItems

		public esQueryItem ShipID
		{
			get { return new esQueryItem(this, FinShippingMetadata.ColumnNames.ShipID, esSystemType.Decimal); }
		} 
		
		public esQueryItem SupplierBoxNo
		{
			get { return new esQueryItem(this, FinShippingMetadata.ColumnNames.SupplierBoxNo, esSystemType.String); }
		} 
		
		public esQueryItem TransferType
		{
			get { return new esQueryItem(this, FinShippingMetadata.ColumnNames.TransferType, esSystemType.String); }
		} 
		
		public esQueryItem FromDestination
		{
			get { return new esQueryItem(this, FinShippingMetadata.ColumnNames.FromDestination, esSystemType.Decimal); }
		} 
		
		public esQueryItem ToDestination
		{
			get { return new esQueryItem(this, FinShippingMetadata.ColumnNames.ToDestination, esSystemType.Decimal); }
		} 
		
		public esQueryItem Replay
		{
			get { return new esQueryItem(this, FinShippingMetadata.ColumnNames.Replay, esSystemType.String); }
		} 
		
		public esQueryItem ReplayDttm
		{
			get { return new esQueryItem(this, FinShippingMetadata.ColumnNames.ReplayDttm, esSystemType.DateTime); }
		} 
		
		public esQueryItem ReplayStatus
		{
			get { return new esQueryItem(this, FinShippingMetadata.ColumnNames.ReplayStatus, esSystemType.String); }
		} 
		
		public esQueryItem IsChecked
		{
			get { return new esQueryItem(this, FinShippingMetadata.ColumnNames.IsChecked, esSystemType.Boolean); }
		} 
		
		public esQueryItem Check1
		{
			get { return new esQueryItem(this, FinShippingMetadata.ColumnNames.Check1, esSystemType.String); }
		} 
		
		public esQueryItem CheckDttm1
		{
			get { return new esQueryItem(this, FinShippingMetadata.ColumnNames.CheckDttm1, esSystemType.DateTime); }
		} 
		
		public esQueryItem Check2
		{
			get { return new esQueryItem(this, FinShippingMetadata.ColumnNames.Check2, esSystemType.String); }
		} 
		
		public esQueryItem CheckDttm2
		{
			get { return new esQueryItem(this, FinShippingMetadata.ColumnNames.CheckDttm2, esSystemType.DateTime); }
		} 
		
		public esQueryItem TransportType
		{
			get { return new esQueryItem(this, FinShippingMetadata.ColumnNames.TransportType, esSystemType.String); }
		} 
		
		public esQueryItem ReceivedBy
		{
			get { return new esQueryItem(this, FinShippingMetadata.ColumnNames.ReceivedBy, esSystemType.String); }
		} 
		
		public esQueryItem ReceivedDttm
		{
			get { return new esQueryItem(this, FinShippingMetadata.ColumnNames.ReceivedDttm, esSystemType.DateTime); }
		} 
		
		public esQueryItem Sender
		{
			get { return new esQueryItem(this, FinShippingMetadata.ColumnNames.Sender, esSystemType.String); }
		} 
		
		public esQueryItem ShippingDate
		{
			get { return new esQueryItem(this, FinShippingMetadata.ColumnNames.ShippingDate, esSystemType.DateTime); }
		} 
		
		public esQueryItem AttachmentName
		{
			get { return new esQueryItem(this, FinShippingMetadata.ColumnNames.AttachmentName, esSystemType.String); }
		} 
		
		public esQueryItem ShippingStatus
		{
			get { return new esQueryItem(this, FinShippingMetadata.ColumnNames.ShippingStatus, esSystemType.String); }
		} 
		
		public esQueryItem Comments
		{
			get { return new esQueryItem(this, FinShippingMetadata.ColumnNames.Comments, esSystemType.String); }
		} 
		
		public esQueryItem CreatedBy
		{
			get { return new esQueryItem(this, FinShippingMetadata.ColumnNames.CreatedBy, esSystemType.String); }
		} 
		
		public esQueryItem CreatedDttm
		{
			get { return new esQueryItem(this, FinShippingMetadata.ColumnNames.CreatedDttm, esSystemType.DateTime); }
		} 
		
		public esQueryItem UpdatedBy
		{
			get { return new esQueryItem(this, FinShippingMetadata.ColumnNames.UpdatedBy, esSystemType.String); }
		} 
		
		public esQueryItem UpdatedDttm
		{
			get { return new esQueryItem(this, FinShippingMetadata.ColumnNames.UpdatedDttm, esSystemType.DateTime); }
		} 
		
		public esQueryItem ShipManagerMail
		{
			get { return new esQueryItem(this, FinShippingMetadata.ColumnNames.ShipManagerMail, esSystemType.String); }
		} 
		
		#endregion
		
	}


	
	public partial class FinShipping : esFinShipping
	{

		
		
	}
	



	[Serializable]
	public partial class FinShippingMetadata : esMetadata, IMetadata
	{
		#region Protected Constructor
		protected FinShippingMetadata()
		{
			m_columns = new esColumnMetadataCollection();
			esColumnMetadata c;

			c = new esColumnMetadata(FinShippingMetadata.ColumnNames.ShipID, 0, typeof(System.Decimal), esSystemType.Decimal);
			c.PropertyName = FinShippingMetadata.PropertyNames.ShipID;
			c.IsInPrimaryKey = true;
			c.IsAutoIncrement = true;
			c.NumericPrecision = 18;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinShippingMetadata.ColumnNames.SupplierBoxNo, 1, typeof(System.String), esSystemType.String);
			c.PropertyName = FinShippingMetadata.PropertyNames.SupplierBoxNo;
			c.CharacterMaxLength = 500;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinShippingMetadata.ColumnNames.TransferType, 2, typeof(System.String), esSystemType.String);
			c.PropertyName = FinShippingMetadata.PropertyNames.TransferType;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinShippingMetadata.ColumnNames.FromDestination, 3, typeof(System.Decimal), esSystemType.Decimal);
			c.PropertyName = FinShippingMetadata.PropertyNames.FromDestination;
			c.NumericPrecision = 18;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinShippingMetadata.ColumnNames.ToDestination, 4, typeof(System.Decimal), esSystemType.Decimal);
			c.PropertyName = FinShippingMetadata.PropertyNames.ToDestination;
			c.NumericPrecision = 18;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinShippingMetadata.ColumnNames.Replay, 5, typeof(System.String), esSystemType.String);
			c.PropertyName = FinShippingMetadata.PropertyNames.Replay;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinShippingMetadata.ColumnNames.ReplayDttm, 6, typeof(System.DateTime), esSystemType.DateTime);
			c.PropertyName = FinShippingMetadata.PropertyNames.ReplayDttm;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinShippingMetadata.ColumnNames.ReplayStatus, 7, typeof(System.String), esSystemType.String);
			c.PropertyName = FinShippingMetadata.PropertyNames.ReplayStatus;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinShippingMetadata.ColumnNames.IsChecked, 8, typeof(System.Boolean), esSystemType.Boolean);
			c.PropertyName = FinShippingMetadata.PropertyNames.IsChecked;
			c.HasDefault = true;
			c.Default = @"((0))";
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinShippingMetadata.ColumnNames.Check1, 9, typeof(System.String), esSystemType.String);
			c.PropertyName = FinShippingMetadata.PropertyNames.Check1;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinShippingMetadata.ColumnNames.CheckDttm1, 10, typeof(System.DateTime), esSystemType.DateTime);
			c.PropertyName = FinShippingMetadata.PropertyNames.CheckDttm1;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinShippingMetadata.ColumnNames.Check2, 11, typeof(System.String), esSystemType.String);
			c.PropertyName = FinShippingMetadata.PropertyNames.Check2;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinShippingMetadata.ColumnNames.CheckDttm2, 12, typeof(System.DateTime), esSystemType.DateTime);
			c.PropertyName = FinShippingMetadata.PropertyNames.CheckDttm2;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinShippingMetadata.ColumnNames.TransportType, 13, typeof(System.String), esSystemType.String);
			c.PropertyName = FinShippingMetadata.PropertyNames.TransportType;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinShippingMetadata.ColumnNames.ReceivedBy, 14, typeof(System.String), esSystemType.String);
			c.PropertyName = FinShippingMetadata.PropertyNames.ReceivedBy;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinShippingMetadata.ColumnNames.ReceivedDttm, 15, typeof(System.DateTime), esSystemType.DateTime);
			c.PropertyName = FinShippingMetadata.PropertyNames.ReceivedDttm;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinShippingMetadata.ColumnNames.Sender, 16, typeof(System.String), esSystemType.String);
			c.PropertyName = FinShippingMetadata.PropertyNames.Sender;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinShippingMetadata.ColumnNames.ShippingDate, 17, typeof(System.DateTime), esSystemType.DateTime);
			c.PropertyName = FinShippingMetadata.PropertyNames.ShippingDate;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinShippingMetadata.ColumnNames.AttachmentName, 18, typeof(System.String), esSystemType.String);
			c.PropertyName = FinShippingMetadata.PropertyNames.AttachmentName;
			c.CharacterMaxLength = 100;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinShippingMetadata.ColumnNames.ShippingStatus, 19, typeof(System.String), esSystemType.String);
			c.PropertyName = FinShippingMetadata.PropertyNames.ShippingStatus;
			c.CharacterMaxLength = 20;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinShippingMetadata.ColumnNames.Comments, 20, typeof(System.String), esSystemType.String);
			c.PropertyName = FinShippingMetadata.PropertyNames.Comments;
			c.CharacterMaxLength = 500;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinShippingMetadata.ColumnNames.CreatedBy, 21, typeof(System.String), esSystemType.String);
			c.PropertyName = FinShippingMetadata.PropertyNames.CreatedBy;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinShippingMetadata.ColumnNames.CreatedDttm, 22, typeof(System.DateTime), esSystemType.DateTime);
			c.PropertyName = FinShippingMetadata.PropertyNames.CreatedDttm;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinShippingMetadata.ColumnNames.UpdatedBy, 23, typeof(System.String), esSystemType.String);
			c.PropertyName = FinShippingMetadata.PropertyNames.UpdatedBy;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinShippingMetadata.ColumnNames.UpdatedDttm, 24, typeof(System.DateTime), esSystemType.DateTime);
			c.PropertyName = FinShippingMetadata.PropertyNames.UpdatedDttm;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinShippingMetadata.ColumnNames.ShipManagerMail, 25, typeof(System.String), esSystemType.String);
			c.PropertyName = FinShippingMetadata.PropertyNames.ShipManagerMail;
			c.CharacterMaxLength = 100;
			c.IsNullable = true;
			m_columns.Add(c);
				
		}
		#endregion	
	
		static public FinShippingMetadata Meta()
		{
			return meta;
		}	
		
		public Guid DataID
		{
			get { return base.m_dataID; }
		}	
		
		public bool MultiProviderMode
		{
			get { return false; }
		}		

		public esColumnMetadataCollection Columns
		{
			get	{ return base.m_columns; }
		}
		
		#region ColumnNames
		public class ColumnNames
		{ 
			 public const string ShipID = "ShipID";
			 public const string SupplierBoxNo = "SupplierBoxNo";
			 public const string TransferType = "TransferType";
			 public const string FromDestination = "FromDestination";
			 public const string ToDestination = "ToDestination";
			 public const string Replay = "Replay";
			 public const string ReplayDttm = "ReplayDttm";
			 public const string ReplayStatus = "ReplayStatus";
			 public const string IsChecked = "IsChecked";
			 public const string Check1 = "Check1";
			 public const string CheckDttm1 = "CheckDttm1";
			 public const string Check2 = "Check2";
			 public const string CheckDttm2 = "CheckDttm2";
			 public const string TransportType = "TransportType";
			 public const string ReceivedBy = "ReceivedBy";
			 public const string ReceivedDttm = "ReceivedDttm";
			 public const string Sender = "Sender";
			 public const string ShippingDate = "ShippingDate";
			 public const string AttachmentName = "AttachmentName";
			 public const string ShippingStatus = "ShippingStatus";
			 public const string Comments = "Comments";
			 public const string CreatedBy = "CreatedBy";
			 public const string CreatedDttm = "CreatedDttm";
			 public const string UpdatedBy = "UpdatedBy";
			 public const string UpdatedDttm = "UpdatedDttm";
			 public const string ShipManagerMail = "ShipManagerMail";
		}
		#endregion	
		
		#region PropertyNames
		public class PropertyNames
		{ 
			 public const string ShipID = "ShipID";
			 public const string SupplierBoxNo = "SupplierBoxNo";
			 public const string TransferType = "TransferType";
			 public const string FromDestination = "FromDestination";
			 public const string ToDestination = "ToDestination";
			 public const string Replay = "Replay";
			 public const string ReplayDttm = "ReplayDttm";
			 public const string ReplayStatus = "ReplayStatus";
			 public const string IsChecked = "IsChecked";
			 public const string Check1 = "Check1";
			 public const string CheckDttm1 = "CheckDttm1";
			 public const string Check2 = "Check2";
			 public const string CheckDttm2 = "CheckDttm2";
			 public const string TransportType = "TransportType";
			 public const string ReceivedBy = "ReceivedBy";
			 public const string ReceivedDttm = "ReceivedDttm";
			 public const string Sender = "Sender";
			 public const string ShippingDate = "ShippingDate";
			 public const string AttachmentName = "AttachmentName";
			 public const string ShippingStatus = "ShippingStatus";
			 public const string Comments = "Comments";
			 public const string CreatedBy = "CreatedBy";
			 public const string CreatedDttm = "CreatedDttm";
			 public const string UpdatedBy = "UpdatedBy";
			 public const string UpdatedDttm = "UpdatedDttm";
			 public const string ShipManagerMail = "ShipManagerMail";
		}
		#endregion	

		public esProviderSpecificMetadata GetProviderMetadata(string mapName)
		{
			MapToMeta mapMethod = mapDelegates[mapName];

			if (mapMethod != null)
				return mapMethod(mapName);
			else
				return null;
		}
		
		#region MAP esDefault
		
		static private int RegisterDelegateesDefault()
		{
			// This is only executed once per the life of the application
			lock (typeof(FinShippingMetadata))
			{
				if(FinShippingMetadata.mapDelegates == null)
				{
					FinShippingMetadata.mapDelegates = new Dictionary<string,MapToMeta>();
				}
				
				if (FinShippingMetadata.meta == null)
				{
					FinShippingMetadata.meta = new FinShippingMetadata();
				}
				
				MapToMeta mapMethod = new MapToMeta(meta.esDefault);
				mapDelegates.Add("esDefault", mapMethod);
				mapMethod("esDefault");
			}
			return 0;
		}			

		private esProviderSpecificMetadata esDefault(string mapName)
		{
			if(!m_providerMetadataMaps.ContainsKey(mapName))
			{
				esProviderSpecificMetadata meta = new esProviderSpecificMetadata();			


				meta.AddTypeMap("ShipID", new esTypeMap("numeric", "System.Decimal"));
				meta.AddTypeMap("SupplierBoxNo", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("TransferType", new esTypeMap("varchar", "System.String"));
				meta.AddTypeMap("FromDestination", new esTypeMap("numeric", "System.Decimal"));
				meta.AddTypeMap("ToDestination", new esTypeMap("numeric", "System.Decimal"));
				meta.AddTypeMap("Replay", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("ReplayDttm", new esTypeMap("datetime", "System.DateTime"));
				meta.AddTypeMap("ReplayStatus", new esTypeMap("varchar", "System.String"));
				meta.AddTypeMap("IsChecked", new esTypeMap("bit", "System.Boolean"));
				meta.AddTypeMap("Check1", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("CheckDttm1", new esTypeMap("datetime", "System.DateTime"));
				meta.AddTypeMap("Check2", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("CheckDttm2", new esTypeMap("datetime", "System.DateTime"));
				meta.AddTypeMap("TransportType", new esTypeMap("varchar", "System.String"));
				meta.AddTypeMap("ReceivedBy", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("ReceivedDttm", new esTypeMap("datetime", "System.DateTime"));
				meta.AddTypeMap("Sender", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("ShippingDate", new esTypeMap("datetime", "System.DateTime"));
				meta.AddTypeMap("AttachmentName", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("ShippingStatus", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("Comments", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("CreatedBy", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("CreatedDttm", new esTypeMap("datetime", "System.DateTime"));
				meta.AddTypeMap("UpdatedBy", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("UpdatedDttm", new esTypeMap("datetime", "System.DateTime"));
				meta.AddTypeMap("ShipManagerMail", new esTypeMap("varchar", "System.String"));			
				
				
				
				meta.Source = "Fin_Shipping";
				meta.Destination = "Fin_Shipping";
				
				meta.spInsert = "proc_Fin_ShippingInsert";				
				meta.spUpdate = "proc_Fin_ShippingUpdate";		
				meta.spDelete = "proc_Fin_ShippingDelete";
				meta.spLoadAll = "proc_Fin_ShippingLoadAll";
				meta.spLoadByPrimaryKey = "proc_Fin_ShippingLoadByPrimaryKey";
				
				this.m_providerMetadataMaps["esDefault"] = meta;
			}
			
			return this.m_providerMetadataMaps["esDefault"];
		}

		#endregion

		static private FinShippingMetadata meta;
		static protected Dictionary<string, MapToMeta> mapDelegates;
		static private int _esDefault = RegisterDelegateesDefault();
	}
}
